package org.darkforest.task;

import org.darkforest.ucenter.service.FestivalRemindService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * Created by pc on 2017/5/10.
 */
@Component
public class MemberFriendRemindTask {
    @Autowired
    private FestivalRemindService festivalRemindService;
    private org.darkforest.common.services.FestivalRemindService fRemindService;

    /***
     * 设置人脉圈提醒
     * 每天凌晨1点执行一次
     */
//    @Scheduled(cron = "0 0 1 * * ?")
    public void batchSetRemindShowFlag(){
        festivalRemindService.batchSetRemindShowFlag();
    }

    /**1、设置人脉圈提醒
     * 2、设置今天之前的纪念日、生日的年为下一年
     * 每天凌晨2点执行一次
     */
//    @Scheduled(cron = "0 0 1 * * ?")
    public void batchSetRemind(){
        festivalRemindService.batchSetRemindShowFlag(); //1
        festivalRemindService.batchSetRemindYear();  //2
    }

    /***
     * 提前三天人脉圈提醒
     * 每天早晨8点钟提醒
     */
//    @Scheduled(cron = "0 0 8 * * ?")
    public void remindMsg(){
        fRemindService.remindMsg();
    }
}
